package com.wzcl.app.dao.model;


import com.wzcl.app.dao.model.common.Base;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.util.Date;

@Data
@Entity
@ApiModel(value = "直播间(相当于一个记录)")
@Table(name = "LiveRoom",
        uniqueConstraints = {
                @UniqueConstraint(columnNames = {"nub"})
        }
)
@EntityListeners(AuditingEntityListener.class)
public class LiveRoom implements Base {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    @ApiModelProperty(value = "房间号")
    private String nub;

    @ApiModelProperty(value = "频道号")
    private Integer channelId;

    @ApiModelProperty(value = "课程号")
    private Integer courseId;

    @ApiModelProperty(value = "直播间名字")
    private String name;

    @CreatedDate
    @ApiModelProperty(value = "创建时间")
    private Date crateTime;

    @ApiModelProperty(value = "开始时间")
    private Date startTime;

    @ApiModelProperty(value = "结束时间")
    private Date endTime;

    @ApiModelProperty(value = "直播推流开始时间")
    private Long start;

    @ApiModelProperty(value = "直播结束开始时间")
    private Long end;

    @ApiModelProperty(value = "直播的场次ID")
    private String sessionId;

    @ApiModelProperty(value = "回放点播ID")
    @Column(columnDefinition = "TEXT")
    private String recordFileId;

    @ApiModelProperty(value = "管理员电话")
    private String teacherPhone;

    @ApiModelProperty(value = "能否修改")
    private Boolean modified;

    @ApiModelProperty(value = "直播间状态")
    private Integer roomState;
}
